package com.znf4.timer;

import java.util.HashMap;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import com.znf4.lucene.IndexService;

/**
 * lucene索引添加 定时器
 * @author agui
 *
 */

@Component
public class LuceneIndexTimer {
	
	
	@Autowired
	private IndexService indexService ;
	
	/**
	 * 函数功能说明 ： 定时添加索引
	 */
//	@Scheduled(fixedDelay = 5000 )
	public Map<String, Object> addIndexDocument() {

		System.out.println("开始实时 索引----------添加Document");
		boolean flag = false  ;// indexService.addIndexDocument();

		Map<String, Object> map = new HashMap<String, Object>();
		if (flag) {
			map.put("success", "200");
			return map;
		}
		System.out.println("实时索引添加内容 返回的结果是  ：" + flag);
		map.put("success", "100");
		return map;

	}
	
	
	
	
	
	
	
	

}
